def count(str):
    """
    
    :param str: 
    :return: 
    """
    num_number = char_number = space_number = other_number = 0
    for char in str:
        if char.isdigit():
            num_number += 1
        elif char.isalpha():
            char_number += 1
        elif char == ' ':
            space_number += 1
        else:
            other_number += 1
    print("%d,%d,%d,%d" % (num_number, char_number, space_number, other_number))
    return num_number, char_number, space_number, other_number


if not count(''):
    print("测试成功")
if count('12abAB [$') == (2,4,1,2):
    print('测试成功')
else:
    print("测试失败")
